import Taro, { Component } from '@tarojs/taro'
import { View, Button, Image } from '@tarojs/components'
import { query as getCurrentOptions } from '@/utils/router'
import LoginButton from '@/components/LoginButton'

import './index.scss'

export default class Login extends Component {
  config = {
    navigationBarTitleText: '登陆'
  }

  toBind = () => {
    const { back = '' } = getCurrentOptions()
    Taro.navigateTo({
      url: `/pages/bind/index?back=${back}`
    })
  }

  render() {
    return (
      <View>
        <View className='login-container center-flex'>
          <View className='login-wrap'>
            <Image className='logo' src={require('./images/logo.png')} />
            <LoginButton />
            <Button
              hover-className='opacity'
              className='center-flex btn phone-btn'
              onClick={this.toBind}
            >
              手机验证码登陆
            </Button>
          </View>
        </View>
      </View>
    )
  }
}
